<%-- 
    Document   : main
    Created on : 2016-12-7, 9:20:12
    Author     : 52461
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title><%=DataConfig.getInstance().getConfig().get("systemName")%></title>
        <link rel="icon" href="${base}/favicon.ico" type="image/x-icon">
        <link href="${base}/css/bootstrap.css" rel="stylesheet">
        <link href="${base}/css/font-awesome.css" rel="stylesheet">
        <link href="${base}/css/material-kit.css" rel="stylesheet">
        <link rel="stylesheet" href="${base}/css/nprogress.css"/>

        <script type="text/javascript" src="${base}/js/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="${base}/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="${base}/js/material.min.js"></script>
        <script type="text/javascript" src="${base}/js/material-kit.js"></script>
        <script type="text/javascript" src="${base}/js/angular/angular.min.js"></script>
        <script type="text/javascript" src="${base}/js/angular-base.js"></script>
        <script type="text/javascript" src="${base}/js/angular/ui-bootstrap-tpls-0.12.0.min.js"></script>
        <script type="text/javascript" src="${base}/js/jquery.cxhd.js"></script>
        <script type="text/javascript" src="${base}/js/nprogress.js"></script>
        <style type="text/css">
            *{margin:0;padding:0;}
            .content_x{
                position: relative;
                width: 100%;
                height: 100%;
            }
            .search_x{
                position: relative;
                width: 100%;
                height:50px;
                border-bottom: 1px #23527c dashed;
            }
            .search_content{
                position: absolute;
                overflow: auto;
                top: 0px;
                bottom: 30px;
                width: 100%;
            }
            .mypage{
                position: absolute;
                bottom: 0px;
                width: 100%;
                margin: 0px;
            }
        </style>
    </head>
    <body ng-app="main" style="font-family: 微软雅黑;height: 100%;overflow: hidden" ng-controller="mainCtrl">
        <div class="col-lg-12" style="margin-top: 20px;">
            <div class="panel panel-default">
                <div class="panel-heading ">
                    <lable class="text-success" style="margin-right: 10px; font-weight: bold">病人列表</lable>

                </div>
                <table id="main" class="table">
                    <tr>
                        <td width="27%" style="border-right: 1px #23527c dashed;padding: 0px;">

                            <div class="content_x">

                                <div class="search_content">
                                    <table class="table table-striped">
                                        <tr>
                                            <th>序号</th>
                                            <th>病人ID</th>
                                            <th>病人名字</th>
                                            <th>性别</th>
                                            <th>年龄</th>
                                            <th>设备</th>
                                            <th>时间</th>
                                            <th>部位</th>
                                            <th>其他</th>
                                        </tr>
                                        <tr id="item_{{$index}}" ng-repeat=" item in lists">
                                            <td >
                                                <span ng-bind="$index"></span>

                                            </td>
                                            <td >
                                                <span ng-bind="item.pat_id"></span>

                                            </td>
                                            <td >
                                                <span ng-bind="item.pat_name"></span>

                                            </td>
                                            <td>
                                                <span ng-if="item.pat_sex == 'F'">女</span>
                                                <span ng-if="item.pat_sex == 'M'">男</span>

                                            </td>
                                            <td >
                                                <span ng-bind="item.pat_age"></span>

                                            </td>
                                            <td >
                                                <span ng-bind="item.modality"></span>

                                            </td>
                                            <td>
                                                <span ng-bind="item.study_datetime"></span>

                                            </td>
                                            <td>
                                                <span ng-bind="item.study_desc"></span>
                                            </td>
                                            <td>
                                                <button ng-click="sendOther(item)" class="btn btn-success btn-xs">发送到平板</button>
                                            </td>

                                        </tr>
                                    </table>
                                </div>
                                <div class="mypage" style="width: 100%;text-align: center">
                                    <pagination ng-change="pageChanged()" previous-text="上一页" next-text="下一页" first-text="第一页" last-text="最后一页" ng-model="data.currentPage" items-per-page="data.pageSize" total-items="data.bigTotalItems" ng-model="data.bigCurrentPage" max-size="data.maxSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages"></pagination>

                                </div>
                            </div>
                        </td>


                    </tr>
                </table>

            </div>
        </div>
    </body>
</html>
<script>

    angular.module('main', ['ui.bootstrap', "baseModule"])
            .controller('mainCtrl', function ($scope, base) {
                $scope.data = {currentPage: 1};

                //体检项目
                $scope.currentPage = 1;
                $scope.pageChanged = function () {
                    $scope.getItem();
                };
                $scope.data.maxSize = 5;
                $scope.data.bigTotalItems = 20;
                $scope.data.bigCurrentPage = 1;
                $scope.data.pageSize = 20;
                $scope.getList = function () {
                    base.post("getList", $scope.data).get(function (data) {
                        console.log(data);
                        $scope.lists = data.list;

                        $scope.data.bigTotalItems = data.totalRow;
                    });
                }
                $scope.getList();

                $scope.sendOther = function (item) {
                    base.post("saveOrder", item).get(function (data) {

                        if (data == 'true') {
                            steveAl("发送成功", 1000);
                        } else if (data == '1') {
                            steveAl("已经发送，请不要重复发送", 1000);
                        }

                    })
                }

            })


    function autoHeight() {
        var bHeight = $(window).height();


        $("#main").height(bHeight - 85);


    }
    autoHeight();


    $(window).resize(function () {
        autoHeight();
    });
</script>
